<?php
			$username=$_POST['username'];
			$user_nickname=$_POST['user_nickname'];
			$goods_type=$_POST['goods_type'];
			$goods_name=$_POST['goods_name'];
			$goods_money=$_POST['goods_money'];
			$quality=$_POST['quality'];
			$school_address=$_POST['school_address'];
			$exchange_way=$_POST['exchange_way'];
			$number=$_POST['number'];
			$contact_phone=$_POST['contact_phone'];
			$contact_qq=$_POST['contact_qq'];
			$contact_wechat=$_POST['contact_wechat'];
			$exchange_status=$_POST['exchange_status'];
			$db=@mysqli_connect('localhost','root','123456','db_exchange')//利用mysqli_connect()连接到数据库
			or die("无法连接到数据库");
			mysqli_query($db,"set names 'utf8'");
			$q="insert into tb_goods_neinfo(username,user_nickname,goods_type,goods_name,goods_money,quality,school_address,exchange_way,number,contact_phone,contact_qq,contact_wechat,exchange_status) values ('$username','$user_nickname','$goods_type','$goods_name','$goods_money','$quality','$school_address','$exchange_way','$number','$contact_phone','$contact_qq','$contact_wechat','$exchange_status')";//定义一条SQL语句，将提交到本页面的username,password数据提交到数据库ex_change中的tb_login表中
			$result=mysqli_query($db,$q);//利用mysqli_query()来执行上面的SQL文件，返回结果我true或者false，将结果返回给$result
			if($result){
				echo "<script>alert('发布成功！');history.back()</script>";
			}
			mysqli_close($db);//断开与数据库的连接
?>